package puzzle.core.tiles;

import org.newdawn.slick.Color;
import org.newdawn.slick.Graphics;
import puzzle.core.Tile;
import puzzle.core.TileType;

public class SolidTile implements Tile {
    
  private TileType type;
  protected Color color;
  
  public SolidTile(TileType t, Color c) {
    this.type = t;
    this.color = c;
  }
  
  public SolidTile(TileType t) {
    this(t, null);
  }
  
  public void render(Graphics g, int x, int y) {
    if (color!=null) {
      Color old = g.getColor();
      g.setColor(color);
      g.fillRect(x, y, Tile.WIDTH, Tile.HEIGHT);
      g.setColor(old);
    }
  }

  public void update(int delta) {
    //do nothing
  }

  public TileType getTileType() {
    return type;
  }
}
